package com.admin.listener;

import com.admin.config.RabbitmqConfig;
import com.admin.service.WemediaNewsAutoScanService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class WemediaNewsAutoListener {

    @Autowired
    private WemediaNewsAutoScanService wemediaNewsAutoScanService;

    @RabbitListener(queues = {RabbitmqConfig.QUEUE_WMNESAUTO_WEMEDIA_ADMIN})
    public void toAutoUpdateStatus(String msg) {
        // 监听Id
        Integer id = (Integer.valueOf(msg));
        wemediaNewsAutoScanService.autoScanByMediaNewsId(id);
    }

}
